package com.ytjj.qmyx.admin.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.common.api.ResultCode;
import com.ytjj.qmyx.admin.model.request.BrandToSpecialRequest;
import com.ytjj.qmyx.admin.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 *
 * @Version: 1.0
 *
 * 品牌管理
 */
@RestController
@RequestMapping("/brand")
public class BrandController {

    @Autowired
    private BrandService brandService;

    /**
     * @Description 获取品牌商列表
     *
     *
     * @Version 1.0
     **/
    @PostMapping("/getBrandNameList")
    public CommonResult getBrandNameList() {
        return CommonResult.success(brandService.getBrandNameList());
    }


    /**
     * @Description 获取品牌商分类列表
     *
     *
     *
     * @Version 1.0
     **/
    @GetMapping("/getSpecialList")
    public CommonResult getSpecialList() {
        return CommonResult.success(brandService.getSpecialList());
    }

    /**
     * @Description 添加品牌商到分类
     *
     *
     *
     * @Version 1.0
     **/
    @PostMapping("/addBrandToSpecial")
    public CommonResult addBrandToSpecial(@RequestBody BrandToSpecialRequest brandToSpecialRequest) {
        brandService.addBrandToSpecial(brandToSpecialRequest);
        return CommonResult.success(ResultCode.SUCCESS);
    }



    /**
     * @Description 添加品牌商到分类
     *
     *
     *
     * @Version 1.0
     **/
    @PostMapping("/addBankerToSpecial")
    public CommonResult addBankerToSpecial(@RequestBody BrandToSpecialRequest brandToSpecialRequest) {
        brandService.addBankerToSpecial(brandToSpecialRequest);
        return CommonResult.success(ResultCode.SUCCESS);
    }

}
